package com.sctu.systemconfiguration;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.WindowManager;

import java.util.List;

/**
 * Created by Administrator on 2015/12/8.
 */
public class GetWindowsize {

    private Context context;

    public GetWindowsize(Context context) {
        this.context = context;
    }

    public int getWindowsWidth() {

        int mScreenWidth;

        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);
        mScreenWidth = outMetrics.widthPixels;
        return mScreenWidth;

    }

    public int getWindowsHight() {

        int mScreenHight;

        WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
        DisplayMetrics outMetrics = new DisplayMetrics();
        wm.getDefaultDisplay().getMetrics(outMetrics);
        mScreenHight = outMetrics.heightPixels;

        return mScreenHight;
    }
}
